<?php
class Comments_Model_Coment{
    public $Id;
    public $NodeId;
    public $Name;
    public $CommentDate;
    public $Text;
    public $ModeratorName;
    public $ResponseDate;
    public $ReponseText;
    public $Publish;
    
    public function __construct($options = null){
        if ($options instanceof Comments_Model_Coment)
    	{
    		$options = $options->toArray();
    		$this->setOptions($options);
    	}
        else if (is_array($options)) {
            $this->setOptions($options);
        }
    }
    
    public function setOptions(array $options){
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
    
    public function toArray(){
    	$vars = get_class_vars(get_class($this));
        foreach ($vars as $var=>$value)
        {
        		$vars[$var] = $this->$var;
        }
        return $vars;
    }
    
    public function getId(){return $this->Id;}
    public function getNodeId(){return $this->NodeId;}
    public function getName(){return $this->Name;}
    public function getCommentDate(){return $this->CommentDate;}
    public function getText(){return $this->Text;}
    public function getModeratorName(){return $this->ModeratorName;}
    public function getResponseDate(){return $this->ResponseDate;}
    public function getReponseText(){return $this->ReponseText;}
    public function getPublish(){return $this->Publish;}

    public function setId($v){$this->Id=$v; return $this;}
    public function setNodeId($v){$this->NodeId=$v; return $this;}
    public function setName($v){$this->Name=$v; return $this;}
    public function setCommentDate($v){$this->CommentDate=$v; return $this;}
    public function setText($v){$this->Text=$v; return $this;}
    public function setModeratorName($v){$this->ModeratorName=$v; return $this;}
    public function setResponseDate($v){$this->ResponseDate=$v; return $this;}
    public function setReponseText($v){$this->ReponseText=$v; return $this;}
    public function setPublish($v){$this->Publish=$v; return $this;}

}
?>